{% extends 'AdminBundle::layout.html.twig' %}

    {% block title %}
        {% if type == 1 %}公告未读人员{% elseif type == 2 %}公告已读人员{% elseif type == 3 %}培训未读人员{% elseif type == 4 %}培训已读人员{% elseif type == 5 %}培训未报名人员{% elseif type == 6 %}培训已报名人员{% endif %}
    {% endblock %}

    {% block css %}{% endblock %}


    {% block top %}
        {#{{ dump() }}#}
        {{ parent() }}
    {% endblock %}



    {% block left_body_top %}
        {{ parent() }}
    {% endblock %}

    {% block left_body %}
        {{ parent() }}
    {% endblock %}

    {% block right_body %}
    <div class="page-header">
        <div class="page-right-top">
            <div class="right-top">
                <span class="right-title">消息通知</span>
            </div>
            <div class="top-nav">{% if type == 1 or type == 2 %}公告列表{% else %}培训通知{% endif %}</div>
            <span class="r-arrow top-r-arrow"></span>
            <div class="top-nav top-nav-active">{% if type == "1" or type == "3"%}未读{% elseif type == "2" or type == "4" %}已读{% elseif type == "5" %}未报名{% elseif type == "6" %}已报名{% endif %}人员</div>
        </div>
        <div class="main-content">
            <div class="mes-content">
                <div class="main-mes-content">
                    <div class="al-released">{% if type == "1" or type == "3"%}未读{% elseif type == "2" or type == "4" %}已读{% elseif type == "5" %}未报名{% elseif type == "6" %}已报名{% endif %}人员列表</div>

                    <table class="table table-hover">
                        <thead>
                        <tr style="background-color: #f3f9fd;">
                            <th style="width: 20%;text-align: center;">姓名</th>
                            <th style="width: 20%;text-align: center;">手机号</th>
                            <th style="width: 40%;text-align: center;">所在公司</th>
                            <th style="text-align: center;">邮箱</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for item in data.data.info %}
                        <tr>
                            <td style="text-align: center;">{{ item.name }}</td>
                            <td style="text-align: center;">{{ item.phone }}</td>
                            <td style="text-align: center;">{{ item.company_full_name }}</td>
                            <td style="text-align: center;">{{ item.email }}</td>
                        </tr>
                        {% endfor %}

                        </tbody>
                    </table>

                    <div class="page-box">
                        <ul class="pagination">






                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    {% endblock %}


{% block box %}
{% endblock %}


{% block javascript %}
<script type="text/javascript">
    $(function () {
        SidebarHighlighting('2');
        SonSidebar('2', '2');

        //分页
        function allPage(){
            var all_page = "{{ data.data.all_page }}";

            var curr_page = "{{ data.data.curr_page }}";

            var article_id = "{{ data.data.article_id }}";
            var page_url = "{{ path('article_training_read_list',{"id":"3545657675454","type":"4656434454656","page":"674342232566"}) }}";

            page_url = page_url.replace("3545657675454",article_id);
            page_url = page_url.replace("4656434454656","{{ type }}");


            var last_page_url = page_url;

            if(parseInt(curr_page) > 1){
                var last_page = parseInt(curr_page) -1;
                last_page_url = last_page_url.replace("674342232566",last_page);
            } else {
                last_page_url = last_page_url.replace("674342232566","1");
            }

            var next_page_url = page_url;
            if(parseInt(curr_page) <  parseInt(all_page)){
                var next_page = parseInt(curr_page) -1;
                next_page_url = next_page_url.replace("674342232566",next_page);
            } else {
                next_page_url = next_page_url.replace("674342232566",all_page);
            }


            var html = '';

            html += '<li><a href="'+ last_page_url +'" class="last-page">&laquo;</a></li>';
            for(var i=1;i<=all_page;i++){
                var curr_page_url = page_url;
                curr_page_url = curr_page_url.replace("674342232566",i);

                if(i == curr_page){
                    html += '<li><a href="'+ curr_page_url +'" class="mes-page-check">'+ i +'</a></li>';
                } else {
                    html += '<li><a href="'+ curr_page_url +'">'+ i +'</a></li>';
                }

            }
            html += '<li><a href="'+ next_page_url +'" class="next-page">&raquo;</a></li>';
            $(".pagination").append(html);
        }

        {% if data.data.all_page > 0 %}
        allPage();
        {% endif %}



    })
</script>
{% endblock %}